package com.bi.bitest.bao.tasks;

import android.util.Log;
import com.bi.bitest.bao.Client.ClientAPI;
import com.bi.bitest.bao.Constants;
import com.bi.bitest.bao.utils.EntityParseUtil;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created
 * Author:bi[FR]
 * Date:15-10-24
 */
public class AlbumDetailTask  extends BaseTask {
private long albumId;
    public  AlbumDetailTask(TaskCallback callback,long albumId){
        super(callback);
        this.albumId=albumId;
    }
    @Override
    protected TaskResult doInBackground(String... params) {
        TaskResult ret=new TaskResult();
        ret.action= Constants.TASK_ALBUMDETAIL;
        JSONObject jsonObject= ClientAPI.getAlbum_AlbumDetail(albumId);

        if(jsonObject!=null){
            try {
                ret.retCode=jsonObject.getInt("ret");
                ret.data= EntityParseUtil.parseAlbum_AalbumDetail(jsonObject);
            } catch (JSONException e) {
                e.printStackTrace();
            }

        }


        return ret;
    }
}
